<%--
*
* 作者： Sky
*
* 描述： 功能授权
*
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:directive.page import="com.toncen.samepms.system.dao.FunctionPermissionDao"/>
<%@include file="/share/header.jsp"%>
<%
	String resourceType=request.getParameter("resourceType");
	String resourceId=request.getParameter("resourceId");
	String subjectType=request.getParameter("subjectType");
	String[] subjectIds=request.getParameterValues("subjectIds");	
	if(subjectIds==null){
		subjectIds=request.getParameterValues("subjectIds[]");	
	}	
	FunctionPermissionDao functionPermissionDao=new FunctionPermissionDao();
	try{
		functionPermissionDao.beginTransaction();
		functionPermissionDao.saveFunctionPermissionsByResource(resourceType,Long.parseLong(resourceId),subjectType,subjectIds);
		functionPermissionDao.commitTransaction();
	}catch(Exception e){
		functionPermissionDao.rollback();
		throw e;
	}finally{
		functionPermissionDao.endTransaction();
	}	
%>	

